<template>
	<view>
		<view class="goods_box">
			<image :src="info.image[0].file_path" style="width: 100%;height: 400rpx;" mode="aspectFill"></image>
			<!-- <scroll-view class="goods_boom" scroll-x="true">
				<view class="goods-list" :class="{goods_active: btn_status == index}" @click="changeClass(index,item)"
					v-for="(item,index) in info.shuju.data">
					{{item.product_name}}
					<view style="display: flex;margin-top: 20rpx;height: 40rpx;line-height: 40rpx;">
						<view style="color: red;font-size: 30rpx;">
							￥{{item.product_price}}
						</view>
						<view style="color: #ccc;font-size: 26rpx;text-decoration:line-through;margin-left: 20rpx;">
							￥{{item.line_price}}
						</view>
					</view>
				</view>
			</scroll-view> -->
						<view style="padding: 20rpx;color: #B7B7B7;">
				已服务：{{info.product_sales}}单
			</view>
			<view class="hr"></view>
			<view style="color: #E96725;padding: 20rpx;display: flex;">
				<image style="width: 40rpx;height: 40rpx;margin-right: 10rpx;vertical-align: middle;"
					src="https://jiechendy.sdshengyue.cn/uploads/d1/f34a7214907ba5d37666d94c6cc12e.png"></image>免费取送
			</view>

		</view>
		<view class="goods_detail">
			<view class="title">团购详情</view>
			<view class="hr1"></view>
			<view class="hr2"></view>
			<view class="detail_box">
				<view class="txt">服务流程</view>
				<view style="width: 100%;display: flex;">
					<view class="order_box">下单服务</view>
					<view class="order_box_dyh">
						<image :src="dyh" style="width: 30rpx;height: 30rpx;" mode="aspectFit"></image>
					</view>
					<view class="order_box">在线预约</view>
					<view class="order_box_dyh">
						<image :src="dyh" style="width: 30rpx;height: 30rpx;" mode="aspectFit"></image>
					</view>
					<view class="order_box">上门取件</view>
					<view class="order_box_dyh">
						<image :src="dyh" style="width: 30rpx;height: 30rpx;" mode="aspectFit"></image>
					</view>
					<view class="order_box">商家服务</view>
					<view class="order_box_dyh">
						<image :src="dyh" style="width: 30rpx;height: 30rpx;" mode="aspectFit"></image>
					</view>
					<view class="order_box">送货上门</view>
				</view>
				<view class="txt">服务内容</view>
				<view style="display: flex;margin: 10rpx 0;">
					<view class="shop_name">商品名称</view>
					<view class="shop_detail">{{info.product_name}}</view>
				</view>
				<view style="display: flex;margin: 10rpx 0;">
					<view class="shop_name">衣物种类</view>
					<view class="shop_detail">羽绒服、羊毛衣、呢子衣、棉衣、冲锋衣(不 含内胆)、运动鞋、雪地靴</view>
				</view>
				<view style="display: flex;margin: 10rpx 0;">
					<view class="shop_name">服务时效</view>
					<view class="shop_detail">5-7天</view>
				</view>
				<view class="txt">注意事项</view>
				<view style="display: flex;margin: 10rpx 0;">
					<view class="shop_name">服务范围</view>
					<view class="shop_detail">套餐仅服务单件购买价值在2000元以内的衣 鞋，超出洗涤范围进行风险退回。</view>
				</view>
				<view style="display: flex;margin: 10rpx 0;">
					<view class="shop_name">服务不含</view>
					<view class="shop_detail">单件购买价值超过2000元以上衣物，湿衣物、旗袍、婚纱、礼服、真丝、皮草皮衣、PU类、带有大量血渍的衣物，韩服、藏族等少数民族</view>
				</view>
				<view style="display: flex;margin: 10rpx 0;">
					<view class="shop_name">退款说明</view>
					<view class="shop_detail">1.团购仅支持一次性使用，不可拆分多次使用 <br>2.如因个别衣物无法洗涤，未洗衣物将与清洗衣物一并送回，未洗衣物退费处理 <br>3.非工厂原因造成的整单衣物不洗涤，退回快递费用由用户承担 </view>
				</view>
			</view>
		</view>
		<view style="width: 100%;height: 200rpx;">

		</view>
		<view class="btn_bottom">
			<button class="person" open-type="im" bindim="onimError" data-im-id='1225213885'>客服</button>
			<view class="buy" @click="buy()">立即下单</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				product_id: '',
				info: {},
				dyh: 'https://jiechendy.sdshengyue.cn/uploads/fb/fe32ff72c26b5552badee43ebf0736.png',
				btn_status: -1,
				buy_data: {}
			};
		},
		methods: {
			getData() {
				let self = this;
				self._get(
					'product.product/detail', {
						product_id: self.product_id,
						visitcode: self.getVisitcode()
					},
					function(res) {
						console.log('res',res);
						self.info = res.data.detail
						console.log('self.info',self.info.image[0]);
					}
				);
			},
			changeClass(index, val) {
				this.btn_status = index
				this.buy_data = val.sku[0]
			},
			buy() {
				let url = '/pages/order/confirm-order?product_id=' + this.info.product_id +
					'&product_num=1&product_sku_id=' + this.info.product_sku.spec_sku_id + '&order_type=buy';
				this.gotoPage(url)
			}

		},
		onLoad(options) {
			this.product_id = options.product_id
			// this.product_id = 55
			console.log(options.id);
			this.getData()
		},
		onimError(e) {
			console.log("拉起IM客服成功", e);
		},

	}
</script>

<style lang="scss">
	.goods-list {
		width: 300rpx;
		height: 130rpx;
		border: 2px solid #F3F3F3;
		display: inline-block;
		border-radius: 20rpx;
		margin-right: 20rpx;
		padding: 20rpx 40rpx;
		font-size: 30rpx;
	}

	.goods_active {
		background-color: #E4EAFA;
		color: #2568BC;
	}

	.goods_boom {
		width: 100%;
		white-space: nowrap;

		padding: 20rpx;
	}

	.btn_bottom {
		position: fixed;
		width: 100%;
		height: 150rpx;
		background-color: #fff;
		bottom: 0;
		display: flex;
		padding-top: 20rpx;
	}

	.person {
		width: 230rpx;
		height: 80rpx;
		text-align: center;
		line-height: 80rpx;
		border-radius: 50rpx;
		color: #fff;
		font-size: 32rpx;
		background: linear-gradient(-90deg, #DDAA69, #DEBC8F);
		margin: 0 40rpx;
	}

	.buy {
		width: 430rpx;
		height: 80rpx;
		text-align: center;
		line-height: 80rpx;
		border-radius: 50rpx;
		color: #fff;
		font-size: 32rpx;
		background: linear-gradient(-90deg, #2264B4, #488BDB);
	}

	.goods_box {
		width: 100%;
		// height: 500rpx;
		background-color: #fff;
		overflow: hidden;
	}

	.hr {
		width: 95%;
		margin-left: 2.5%;
		height: 1rpx;
		background-color: #F8F8F8;
		margin-top: 10rpx;
	}

	.goods_detail {
		width: 100%;
		margin-top: 20rpx;
		background-color: #fff;
		// height: 300rpx;
	}

	.hr1 {
		width: 6%;
		margin-left: 47%;
		height: 2px;
		background-color: #2568BC;
	}

	.hr2 {
		width: 100%;
		height: 1rpx;
		background-color: #F8F8F8;
		margin: 10rpx 0;
	}

	.title {
		padding-top: 20rpx;
		width: 100%;
		text-align: center;
		font-size: 34rpx;
		color: #2568BC;
		margin-bottom: 10rpx;
	}

	.detail_box {
		width: 90%;
		margin-left: 5%;

		.txt {
			font-size: 32rpx;
			font-weight: bold;
			margin-top: 40rpx;
			margin-bottom: 20rpx;
		}
	}

	.order_box {
		width: 80rpx;
		height: 80rpx;
		border-radius: 10rpx;
		box-shadow: rgba(0, 0, 0, 0.35) 0px 1px 5px;
		text-align: center;
		font-size: 30rpx;
		padding: 10rpx;
	}

	.order_box_dyh {
		margin: 0 10rpx;
		height: 100rpx;
		text-align: center;
		padding-top: 35rpx;
	}

	.shop_name {
		width: 25%;
		font-size: 30rpx;
		color: #9F9F9F;
	}

	.shop_detail {
		width: 75%;
		font-size: 30rpx;
	}
</style>